package com.leyou.common.bean;

import lombok.Getter;

/**
 * @author zqq
 * @ClassName ResultCode
 * @Description: 错误消息定制类
 * @date 2020/3/5-10:17
 */
@Getter
public enum ResultCode {

    /* 返回成功码 */
    SUCCESS(1, "成功"),

    /* 参数错误：1001-1999 */
    PARAM_NULL_ERROR(1001, "参数缺失"),
    PARAM_NOT_NULL(1002, "参数不能为空"),
    PARAM_REQUEST_ERROR(1003, "参数请求错误"),
    P_INVALID(1004, "参数非法"),
    P_NICK_NAME_TOO_LONG(1005, "昵称过长"),
    P_TYPE_INVALID_EXCEPTION(1006," 参数类型不匹配异常 "),
    PARAM_SEARCH_NOT_NULL(1007, "搜索条件不能为空"),

    /* 用户错误: 2001-2999 */
    USER_ADD_CATEGORY_ERROR(2001, "禁止添加四级类目"),
    USER_GET_USERIFNO_NULL(2002, "获取用户信息失败"),
    USER_NOT_EXIST(2003, "用户不存在"),
    USER_NOT_VERIFIED(2004, "用户没有验证"),
    USER_LOGIN_ERROR(2005, "登录密码错误"),
    USER_ACCOUNT_LOCKED(2006, "您的账号已被锁定"),
    USER_ACCOUNT_ENABLED(2007, "您的账号已被禁用"),
    USER_LOGOUT_FALT(2008, "注销异常"),
    USER_PHONE_NOT_EXIST(2011,"手机号不存在"),
    USER_NOT_UPDATE_PHONE_EXIST(2012,"手机号已存在"),
    USER_ALREADY_HAVE_EXIST(2013,"用户已存在"),
    USER_SET_ROLE_EXIST(2014,"请为用户分配角色"),
    USER_NOT_AUTHORIZE_FAIL(2015,"无权访问后台系统"),
    USER_ALREADY_BIND_FAIL(2016,"手机号已被绑定"),

    /* 系统错误: 3001-3999 */
    S_REQUEST_TIME_OUT(3004,"请求超时, 请稍后重试"),
    S_NULL_POINTER_EXCEPTION(3005, "请求发生了空指针异常，请稍后再试"),
    S_RUNTIME_EXCEPTION(3006, "请求发生了运行时异常，请稍后再试"),
    S_SYSTEM_EXCEPTION(3007, "系统异常，请稍后再试"),
    S_SYSTEM_VISIT_EXCEPTION(3003, "非法访问，未登录"),
    S_SYSTEM_NOT_GENERATE_ID(3008, "系统生成ID出错"),
    S_SYSTEM_CHANGE_JSON_EXCEPTION(3009,"JSON转换出错"),
    S_SEND_SMS_ERROR(3010,"发送短信异常"),
    S_SYSTEM_ENCRYPTION_EXCEPTION(3011,"加密异常"),
    S_SYSTEM_IMPORT_EXCEPTION(3012,"导入异常"),
    S_SYSTEM_DATA_EXCEPTION(3013,"数据异常，请稍后再试"),
    S_UPLOADING_EXCEPTION(3014,"上传错误"),
    S_SYSTEM_DATE_CHANGE_EXCEPTION(3017,"日期转换异常，请稍后再试"),
    S_SYSTEM_API_EXCEPTION(3018,"接口异常"),


    /** 系统验证提示: 4001-4999 */
    V_TOKEN_ANALYSIS_FAIL(4004, "token解析异常"),
    V_GET_TOKEN_FAIL(4005, "生成token失败"),
    V_TOKEN_UNAUTHORIZED_FAIL(4006, "认证失败, 未授权"),
    V_TOKEN_EXP(4007, "Token已过期, 重新登录"),
    V_LOGIN_TYPE_PARAM_ERROR(4008, "登录参数类型错误"),
    V_VERIFYCODE_EXPIRED(4009, "验证码已过期"),
    V_VERIFYCODE_INVALID(4010, "无效的验证码"),
    V_VERIFYCODE_ERROR(4011, "验证码错误"),
    V_LIMIT_REQUEST_SUPERIOR(4013, "请求过于频繁"),
    V_NOT_AUTHORIZE_ERROR(4014, "请求失败，无权访问"),

    /** 后台相关系统提示：5001-5999*/
    OPERATOR_GROUPMANAGER_INSERT_FAIL(5001, "角色添加错误"),
    OPERTOR_GROUPMANAGER_UPDATE_FAIL(5002, "角色修改错误"),
    USER_UPLOAD_TYPE_FAIL(5003,"文件类型不合法"),
    USER_UPLOAD_CONTENT_FAIL(5004,"文件内容不合法"),

    /** 订单和商品相关错误 */
    ORDER_INSERT_FAIL(6002, "添加订单错误"),
    ORDER_UPDATE_FAIL(6003, "修改订单错误"),
    ORDER_PAY_STATE_FAIL(6004, "订单支付错误"),
    ORDER_PAY_ALIPAY_FAIL(6005, "获取支付宝支付信息错误"),
    ORDER_PAY_WXPAY_FAIL(6006, "获取微信支付信息错误"),
    ORDER_NULL_FAIL(6009, "订单不存在"),
    PAYMENT_STATE_ERROR(6010, "订单支付信息错误"),
    GOODS_NULL_FAIL(6011, "商品不存在");


    private int code;
    private String msg;
    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
